//
//  Qb_MessageListViewController.m
//  Cd_Qb
//
//  Created by mac on 2018/3/15.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "Qb_MessageListViewController.h"
#import "Qb_MessageListTableViewCell.h"
#import "Qb_MessageDetailViewController.h"

static NSString * ID = @"MessageListCell";

@interface Qb_MessageListViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (weak, nonatomic) IBOutlet UITableView *messageListTableView;


@end

@implementation Qb_MessageListViewController

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = NO;
    self.tabBarController.tabBar.hidden = YES;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self AdaptationApp];
    
    self.title = @"系统消息";
    self.messageListTableView.delegate = self;
    self.messageListTableView.dataSource = self;
    self.messageListTableView.rowHeight = 90;
    
    self.messageListTableView.separatorStyle = UITableViewCellSelectionStyleNone;
    self.messageListTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    // Do any additional setup after loading the view.
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    Qb_MessageListTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:ID];
    
    if (!cell)
    {
        cell = [Qb_MessageListTableViewCell MessageListCell];
    }
    return cell;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 3;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    Qb_MessageDetailViewController * con = (Qb_MessageDetailViewController*)Storyboard(@"MessageDetail", @"MessageDetailView");
    con.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:con animated:YES];
}

@end
